
local key_pressed_map = {};

function commonlib.SetKeyPressed(keycode, pressed)
    key_pressed_map[keycode] = pressed;
end

function commonlib.IsKeyPressed(keycode)
    return key_pressed_map[keycode];
end

function commonlib.IsCtrlKeyPressed()
    return commonlib.IsKeyPressed(commonlib.KEYCODE_LCONTROL) or commonlib.IsKeyPressed(commonlib.KEYCODE_RCONTROL);
end

function commonlib.IsShiftKeyPressed()
    return commonlib.IsKeyPressed(commonlib.KEYCODE_LSHIFT) or commonlib.IsKeyPressed(commonlib.KEYCODE_RSHIFT);
end

function commonlib.IsAltKeyPressed()
    return commonlib.IsKeyPressed(commonlib.KEYCODE_LALT) or commonlib.IsKeyPressed(commonlib.KEYCODE_RALT);
end
